<template>
  <div class="learning-plan-container">
          <!-- 返回按钮 -->
      <div class="back-section">
        <router-link to="/talentTrainingPage" class="back-link">
          <span class="back-icon">←</span>
          <span>返回</span>
        </router-link>
      </div>
    <!-- 页面标题 -->
    <div class="page-header">
      <h1>学习计划</h1>
      <p>选择您感兴趣的专业或者职业，获取学习路径和资源推荐</p>
    </div>
    
    <!-- 主要内容区域 -->
    <div class="main-content">
      <!-- 专业分类区域 -->
      <div class="career-section">
        <h2>专业分类</h2>
        <div class="career-grid">
          <div 
            v-for="major in majors" 
            :key="major.id"
            class="career-card"
            @click="navigateToDetail('major', major.id)"
          >
            <div class="career-icon">{{ major.icon }}</div>
            <h3>{{ major.name }}</h3>
            <p class="career-desc">{{ major.description }}</p>
          </div>
        </div>
      </div>
      
      <!-- 职业分类区域 -->
      <div class="career-section">
        <h2>职业分类</h2>
        <div class="career-grid">
          <div 
            v-for="career in careers" 
            :key="career.id"
            class="career-card"
            @click="navigateToDetail('career', career.id)"
          >
            <div class="career-icon">{{ career.icon }}</div>
            <h3>{{ career.name }}</h3>
            <p class="career-desc">{{ career.description }}</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';

const router = useRouter();

// 专业数据
const majors =[
  {id:'computer',name:'计算机专业',description:'专业介绍',icon:'💻'},
  {id:'finance',name:'金融专业',description:'专业介绍',icon:'💰'}
];

// 职业数据
const careers = [
  {
    id: 'lawyer',
    name: '律师',
    description: '为客户提供法律咨询和代理服务',
    icon: '⚖️'
  },
  {
    id: 'programmer',
    name: '程序员',
    description: '设计、开发和维护软件系统',
    icon: '💻'
  },
  {
    id: 'accountant',
    name: '会计',
    description: '负责财务核算和财务管理',
    icon: '📊'
  },
  {
    id: 'doctor',
    name: '医生',
    description: '诊断和治疗疾病，维护健康',
    icon: '👨‍⚕️'
  },
  {
    id: 'architect',
    name: '建筑师',
    description: '设计和规划建筑物',
    icon: '🏗️'
  }
];

// 跳转到详情页
const navigateToDetail = (type, id) => {
  router.push({ name: 'LearningPlanDetail', params: { type, id } });
};
</script>

<style scoped>
/* 主容器样式 */
.learning-plan-container {
  min-height: 100vh;
  background-color: #f5f7fa;
  padding: 30px 20px;
}

/* 页面标题样式 */
.page-header {
  text-align: center;
  margin-bottom: 40px;
}

.page-header h1 {
  font-size: 36px;
  color: #2c3e50;
  margin-bottom: 10px;
  font-weight: 700;
}

.page-header p {
  font-size: 18px;
  color: #7f8c8d;
}

/* 主要内容区域 */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
}

/* 职业分类区域 */
.career-section {
  margin-bottom: 50px;
}

.career-section h2 {
  font-size: 24px;
  color: #2c3e50;
  margin-bottom: 20px;
  text-align: center;
}

.career-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.career-card {
  background: white;
  border-radius: 10px;
  padding: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 2px solid transparent;
}

.career-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.career-icon {
  font-size: 48px;
  margin-bottom: 15px;
  text-align: center;
}

.career-card h3 {
  font-size: 20px;
  color: #2c3e50;
  margin-bottom: 10px;
  text-align: center;
}

.career-desc {
  color: #7f8c8d;
  text-align: center;
  font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .career-grid {
    grid-template-columns: 1fr;
  }
  
  .page-header h1 {
    font-size: 28px;
  }
}
</style>